<template>
  <div>
    用户名: <input type="text" v-model="form.username">
    密码: <input type="text" v-model="form.password">
    <button @click="login">登录</button>

  </div>
</template>

<script>
export default {
  name: "tlogin",
  data() {
    return {
      form: {},
    }
  },
  methods: {
    login() {
      this.axios.post('goods/teacherLogin/', this.from)
        .then(res => {
          if (res.data.code == 200) {
            localStorage.getItem('tuserid', res.data.tid)
            localStorage.getItem('tusername', res.data.tname)
          }
        })
    },
  },
  mounted() {

  }
}
</script>

<style scoped>

</style>
